package com.atguigu.gulimall.order;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

/**
 * 使用rabbitmq
 * 1、引入amqp场景,RabbitAutoConfiguration自动启动
 * 2、给容器中自动配置了 RabbitTemplate AmqpAdmin CachingConnectFactory
 * 3、配置文件配置
 * 4、@EnableRabbit:@EnableXXX
 * 5、监听消息使用@RabbitListener
 *  @RabbitListener ：类+方法
 *  @RabbitHandler :方法 可以重载区分不同的消息
 *
 *  Seata控制分布式事务
 *  1）每一个微服务先必须创建undo_log表
 *  2）导入依赖spring-cloud-starter-alibaba-seata
 *      修改register.conf
 *  3)标记注解
 *  4)每一个微服务，使用seata代理数据源
 *  5)每个微服务都必须导入file.conf,registry.conf
 *      修改配置vgroup_mapping.gulimall-order-fescar-service-group = "default"
 */
@SpringBootApplication
@MapperScan("com.atguigu.gulimall.order.dao")
@EnableDiscoveryClient
@EnableRabbit
@EnableFeignClients("com.atguigu.gulimall.order.feign")
public class OrderApplication {

    public static void main(String[] args) {
        SpringApplication.run(OrderApplication.class, args);
    }

}
